
//Project Management -> Sites
dmdPMApp.directive('siteslist', ['projTabsService', function(projTabsService){
	return {
		restrict:"E",
		scope:{
			tablist:'=',
			ondelete:'&'
		},
		templateUrl:"static/partials/sites/siteslist-directive.html",
		controller:function ($scope, $attrs) {
			$scope.openProjectSite = function (projSiteName, projSiteId) {
				var projSiteTmpl = "<projectsite projsiteid='" + projSiteId + "'></projectsite>";
				projTabsService.addTab(projSiteName, projSiteTmpl);
			};
		}
	};
}]);


//View Project Site from
//1. Project Create/Edit page
//2. Sites List page
dmdPMApp.directive('projectsite', function () {
        return {
            restrict:"E",
            scope:{
                tablist:'=',
                ondelete:'&'
            },
            templateUrl:"static/partials/sites/projectsite-directive.html",
            controller:function ($scope, $attrs) {
                $scope.save = function () {
                	alert("saved");
                };
            }
        };
});



